@import '../../style/themes/index.less';

@tabs-prefix-cls: ~'@{prefix}-tabs';
@panel-prefix-cls: ~'@{prefix}-tab-panel';
@tab-prefix-cls: ~'@{prefix}-tab';
@tabbar-prefix-cls: ~'@{prefix}-tabbar';
@scrollable-prefix-cls: ~'@{prefix}-scrollable-tabbar';

.@{tabs-prefix-cls} {
  overflow: hidden;
  font-size: 28px;
}

.@{tab-prefix-cls} {
  display: inline-block;
  box-sizing: border-box;
  height: 100%;
  margin: 0 32px 0;
  padding: 24px 32px;
  text-decoration: none;
  cursor: pointer;
  outline: none;
  transition: color, border 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
  margin-bottom: -4px;
  border-bottom: 4px solid transparent;

  &.active {
    background-color: none;
    border-bottom: 4px solid @primary-color;
  }

  &.active {
    color: @primary-color;
  }

  &.disabled {
    color: @disabled-color;
    cursor: not-allowed;
  }

  &:last-child {
    margin-right: 0;
  }
}

.@{panel-prefix-cls} {
  // display: none;
  width: 100%;
  opacity: 1;
  box-sizing: border-box;

  &.active {
    display: block;
  }
}

.@{tabbar-prefix-cls} {
  user-select: none;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  zoom: 1;

  &:after {
    display: block;
    content: '.';
    clear: both;
    line-height: 0;
    visibility: hidden;
  }
}

.@{scrollable-prefix-cls} {
  position: relative;
  box-sizing: border-box;

  &-wrap {
    overflow: hidden;
    margin: 0 0 32px 0;
    border-bottom: 2px solid #e8e8e8;
  }

  &-inner {
    display: flex;
    flex-direction: row;
    width: 100%;
  }

  &.vertical {
    .tabs-icon {
      margin-top: 0;
    }

    .@{scrollable-prefix-cls}-inner,
    .@{scrollable-prefix-cls}-wrap {
      height: 100%;
    }

    .@{tab-prefix-cls} {
      height: auto;
    }

    .tabs-arrow {
      &.tab-prev {
        left: 0;
        top: 0;
      }

      &.tab-next {
        left: 0;
        top: initial;
        bottom: 0;
      }
    }
  }

  .@{tab-prefix-cls} {
    flex-basis: 33%;
    flex: none;
  }

  .@{tabbar-prefix-cls} {
    transition: transform 0.3s cubic-bezier(0.35, 0, 0.25, 1);
    justify-content: space-between;
  }

  .tabs-arrow {
    display: none;
    align-items: center;
    justify-content: center;
    margin-right: -4px;
    width: 0;
    height: 0;
    top: 0;
    text-align: center;
    opacity: 0;
    transition: 0.3s;
    opacity: 1;
    width: 0px;
    height: 100%;
    position: absolute;
    user-select: none;
    z-index: 1;
    cursor: pointer;
    color: #ccc;
    overflow: hidden;

    &:hover {
      color: #333;
    }

    &.tab-prev {
      left: 0;
    }

    &.tab-next {
      right: 4px;
    }
  }

  .tabs-icon {
    position: relative;
    display: inline-block;
    font-style: normal;
    font-weight: normal;
    font-variant: normal;
    line-height: inherit;
    vertical-align: baseline;
    text-align: center;
    text-transform: none;
    font-family: sans-serif;
    vertical-align: sub;
  }

  &.arrow.overflow {
    padding: 0 64px;

    .@{tabbar-prefix-cls} {
      border: none;
    }

    .tabs-arrow {
      display: flex;
      width: 64px;
    }

    .@{tabbar-prefix-cls} {
      justify-content: initial;
    }
  }

  &.vertical {
    .@{scrollable-prefix-cls}-wrap {
      border-bottom: none;
    }
  }

  &.arrow.vertical.overflow {
    padding: 46px 0;
    .tabs-arrow {
      display: flex;
      width: 100%;
      height: 46px;
    }
  }
}
